﻿using UnityEngine;
using System.Collections;

public class OnClick : MonoBehaviour {
    public AudioClip PopupSound;
    public Texture Move, Cancel, Attack;
    
    protected bool Touched = false;
    protected bool OutOfRange = false;
    protected GUIStyle style = new GUIStyle();
    protected Vector2 screenPos;
    protected Rect windowRect = new Rect(20, 20, 100, 200);

    protected virtual void OnGUI()
    {
    }
    protected virtual void OnMouseDown()
    {
        if (PopupSound)
            AudioSource.PlayClipAtPoint(PopupSound, transform.position);
        if (!Touched)
        {
            screenPos = new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y);
            Touched = true;
        }
        else
        {
            Touched = false;
        }
    }
    protected virtual void OnMouseEnter()
    {
       
    }
    protected virtual void OnMouseExit()
    {

    }
    protected virtual void WindowPopup(int windowID){
        
    }
}
